﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GH.Web
{
    public partial class AjaxDelete : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //处理画面区分
                string strFormFlg = Request["FormFlg"].ToString();
                string strID = Request["ID"].ToString();
                switch (strFormFlg)
                {
                    //用户
                    case "USER":
                        break;
                    //部门管理
                    case "DepartMent":
                        break;
                    //班组管理 WorkGroup
                    case "WorkGroup":
                        break;
                    //角色管理  Role
                    case "Role":
                        break;
                    //会员管理  VipMember
                    case "VipMember":
                        break;
                    //家庭管理  
                    case "Family":
                        break;
                    //权限设置管理  Role
                    case "RoleSet":
                        break;
                    //工会组织机构统计表 
                    case "OrganizationSumirise":
                        BLL.ReportOrganization bllReportOrganization = new GH.BLL.ReportOrganization();
                        bllReportOrganization.Delete(Convert.ToInt32(strID), Convert.ToInt32(Request["UnionID"].ToString()));
                        break;
                    //互助员工
                    case "MutualMemberSumirise":
                        BLL.MutualMember bllMutualMember = new GH.BLL.MutualMember();
                        bllMutualMember.Delete(Convert.ToInt32(strID));
                        break;
                    //疗养情况
                    case "RecuperateCondationSumirise":
                        BLL.RecuperateCondation bllRecuperateCondation = new GH.BLL.RecuperateCondation();
                        bllRecuperateCondation.Delete(Convert.ToInt32(strID));
                        break;
                    //疗养计划
                    case "RecuperatePlan":
                        string RecuperatePlanDate = Request["theDate"].ToString();
                        BLL.RecuperatePlan bllRecuperatePlan = new GH.BLL.RecuperatePlan();
                        bllRecuperatePlan.Delete(Convert.ToInt32(strID), RecuperatePlanDate);
                        break;
                    //专职工会干部统计
                    case "LeaderSummrise":
                        BLL.LeaderSummrise bllLeaderSummrise = new GH.BLL.LeaderSummrise();
                        bllLeaderSummrise.Delete(Convert.ToInt32(strID));
                        break;
                    //聘用各类劳务人员入会率统计表
                    case "EmployMemberShipRate":
                        string EmployMemberShipRateDate = Request["theDate"].ToString();
                        BLL.EmployMemberShipRate bllEmployMemberShipRate = new GH.BLL.EmployMemberShipRate();
                        bllEmployMemberShipRate.Delete(Convert.ToInt32(strID), EmployMemberShipRateDate);
                        break;
                    //DemocraticManagement
                    case "DemocraticManagement":
                        BLL.DemocraticManagement bllDemocraticManagement = new GH.BLL.DemocraticManagement();
                        bllDemocraticManagement.Delete(int.Parse(this.Session["UnionSelect"].ToString()), Request["CurrentYear"].ToString());

                        break;
                    //劳动模范情况统计表
                    case "ModelWorker":
                        BLL.ModelWorker bllModelWorker = new GH.BLL.ModelWorker();
                        bllModelWorker.Delete1(Convert.ToInt32(strID));
                        break;
                    //劳动模范情况统计表
                    case "ModelWorker1":
                        BLL.ModelWorker bllModelWorker1 = new GH.BLL.ModelWorker();
                        bllModelWorker1.Delete2(Convert.ToInt32(strID));
                        break;
                    //各类员工入会率统计 
                    case "MemberShipRate":
                        string MemberShipRateDate = Request["theDate"].ToString();
                        BLL.MemberShipRate bllMemberShipRate = new GH.BLL.MemberShipRate();
                        bllMemberShipRate.Delete(Convert.ToInt32(strID), MemberShipRateDate);
                        break;

                    //工会建家
                    case "UnionBuiltHome":
                        BLL.UnionBuiltHome bllUnionBuiltHome = new GH.BLL.UnionBuiltHome();
                        bllUnionBuiltHome.Delete(Convert.ToInt32(strID));
                        break;
                    case "LegalAid":
                        BLL.LegalAid bllLegalAid = new GH.BLL.LegalAid();
                        bllLegalAid.Delete(int.Parse(this.Session["UnionSelect"].ToString()), Request["CurrentYear"].ToString());
                        break;
                    case "LeaderTrain":
                        string LeaderTrainDate = Request["theDate"].ToString();
                        BLL.LeaderTrain bllLeaderTrain = new GH.BLL.LeaderTrain();
                        bllLeaderTrain.Delete(Convert.ToInt32(strID), LeaderTrainDate);
                        break;

                }
                Response.Write("OK");
            }
            catch
            {
                Response.Write("NG");
            }
            Response.End();
        }
    }
}
